raar.agent.process.sensor
Class RAObjectSensor

java.lang.Object
  extended by raar.agent.process.RAProcess
      extended by raar.agent.process.sensor.RASensor
          extended by raar.agent.process.sensor.RARegionSensor
              extended by raar.agent.process.sensor.RARegionSensor_Pie
                  extended by raar.agent.process.sensor.RAObjectSensor
All Implemented Interfaces:
java.io.Serializable, RAAgentDependentProcess, RAWorldDependentProcess, RASensorUserSelectable

public class RAObjectSensor
extends RARegionSensor_Pie
implements RAWorldDependentProcess, RASensorUserSelectable

A sensor with a response to objects of a certain class within a pie-piece- shaped region. Returns the distance to the nearest object of a certain class, relative to the radius of the pie.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class raar.agent.process.sensor.RASensor
agent, output, outputName
 
Fields inherited from class raar.agent.process.RAProcess
hasRun, inregister, outregister, register, sourceCode, statement
 
Fields inherited from interface raar.agent.process.RAWorldDependentProcess
NO_OBJECT_DEFINED
 
Fields inherited from interface raar.agent.process.RAAgentDependentProcess
NO_AGENT_DEFINED
 
Constructor Summary
RAObjectSensor()
          Default constructor.
RAObjectSensor(RAAgent agent)
          Construct the sensor.
 
Method Summary
 java.lang.String explain()
          Explain what the sensor does.
 java.lang.String getClassName()
          Get class name.
 java.awt.Color getColor()
          Get color.
 java.lang.String getProcessableName()
          Return the perceived class (or object) name.
 boolean isProcessable(RAWorldObject obj)
          Return whether the object in question is perceivable by this sensor with current settings.
 boolean isSuitable(RAWorldObject obj)
          Return whether the object in question is suitable for this sensor regardless of current settings.
 void setClassName(java.lang.String className)
          Set class name.
 void setProcessableName(java.lang.String name)
          Set the perceived class (or object) name.
 java.lang.String toString()
          String representation.
 boolean usesClasses()
          Return whether this sensor uses classes (true) or objects (false).
 
Methods inherited from class raar.agent.process.sensor.RARegionSensor_Pie
getDirection, getRadius, getRegion, getSectionWidth, setDirection, setRadius, setSectionWidth
 
Methods inherited from class raar.agent.process.sensor.RARegionSensor
run
 
Methods inherited from class raar.agent.process.sensor.RASensor
acceptsInput, dumpRegisters, execute, get, getAgent, getDataType, getInputNames, getInputObjects, getOutputNames, getOutputObjects, getSensorValue, isSpecial, removeReferenceToAgent, set, setAgent, setOutput, setReferenceToAgent, setSourceCode, suppliesOutput
 
Methods inherited from class raar.agent.process.RAProcess
clone, getProcessName, getSourceCode, reset, setProcessName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RAObjectSensor

public RAObjectSensor()
Default constructor.


RAObjectSensor

public RAObjectSensor(RAAgent agent)
Construct the sensor.

Method Detail

setClassName

public void setClassName(java.lang.String className)
Set class name.


getClassName

public java.lang.String getClassName()
Get class name.


getColor

public java.awt.Color getColor()
Get color.

Overrides:
getColor in class RASensor

toString

public java.lang.String toString()
String representation.

Specified by:
toString in class RASensor

explain

public java.lang.String explain()
Explain what the sensor does.

Specified by:
explain in class RASensor

isSuitable

public boolean isSuitable(RAWorldObject obj)
Return whether the object in question is suitable for this sensor regardless of current settings.

Specified by:
isSuitable in interface RAWorldDependentProcess

isProcessable

public boolean isProcessable(RAWorldObject obj)
Return whether the object in question is perceivable by this sensor with current settings.

Specified by:
isProcessable in interface RAWorldDependentProcess

usesClasses

public boolean usesClasses()
Return whether this sensor uses classes (true) or objects (false).

Specified by:
usesClasses in interface RAWorldDependentProcess

getProcessableName

public java.lang.String getProcessableName()
Return the perceived class (or object) name.

Specified by:
getProcessableName in interface RAWorldDependentProcess

setProcessableName

public void setProcessableName(java.lang.String name)
Set the perceived class (or object) name.

Specified by:
setProcessableName in interface RAWorldDependentProcess